<template>
	<view style="display: flex;flex-direction: column;">
		<view class="qrcode">
			<canvas  style="width: 600upx;height: 600upx;" canvas-id="couponQrcode"></canvas>
		</view>
		<view class="title">
			打开商家端 扫一扫付款
		</view>
	</view>
</template>

<script>
	const qrCode = require('@/common/QR/weapp-qrcode.js')
	export default {
		data() {
			return {

			}
		},
		onLoad() {
			setTimeout(() => {
				this.couponQrCode()
			}, 50)
		},
		methods: {
			// 二维码生成工具
			couponQrCode() {
				new qrCode('couponQrcode', {
					text: "http://www.baidu.com",
					width: 330,
					height: 330,
					colorDark: "#333333",
					colorLight: "#FFFFFF",
					correctLevel: qrCode.CorrectLevel.H
				})
			}
		}
	}
</script>

<style>
	.qrcode {
		margin-top: 100rpx;
		display: flex;
		justify-content: center;
	}
	.title {
		display: flex;
		text-align: center;
		font-size: 40rpx;
		color: #b3b3b3;
		margin-top: 30rpx;
		justify-content: center;
	}
</style>